{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "initial_id",
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2024-01-15T09:19:06.405796700Z",
     "start_time": "2024-01-15T09:19:02.769484900Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Cannot import deform_conv_ext. Error: . You may need to: \n",
      " 1. compile with BASICSR_EXT=True. or\n",
      " 2. set BASICSR_JIT=True during running\n",
      "Cannot import deform_conv_ext. Error: . You may need to: \n",
      " 1. compile with BASICSR_EXT=True. or\n",
      " 2. set BASICSR_JIT=True during running\n",
      "----------------------------------------------------------------\n",
      "        Layer (type)               Output Shape         Param #\n",
      "================================================================\n",
      "            Conv2d-1          [4, 32, 256, 256]             896\n",
      "            Conv2d-2          [4, 32, 256, 256]           9,248\n",
      "              ReLU-3          [4, 32, 256, 256]               0\n",
      "            Conv2d-4          [4, 32, 256, 256]           9,248\n",
      " AdaptiveAvgPool2d-5              [4, 32, 1, 1]               0\n",
      "            Conv2d-6               [4, 4, 1, 1]             132\n",
      "              ReLU-7               [4, 4, 1, 1]               0\n",
      "            Conv2d-8              [4, 32, 1, 1]             160\n",
      "           Sigmoid-9              [4, 32, 1, 1]               0\n",
      "       RC_CALayer-10          [4, 32, 256, 256]               0\n",
      "             RCAB-11          [4, 32, 256, 256]               0\n",
      "           Conv2d-12          [4, 32, 256, 256]           9,248\n",
      "             ReLU-13          [4, 32, 256, 256]               0\n",
      "           Conv2d-14          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-15              [4, 32, 1, 1]               0\n",
      "           Conv2d-16               [4, 4, 1, 1]             132\n",
      "             ReLU-17               [4, 4, 1, 1]               0\n",
      "           Conv2d-18              [4, 32, 1, 1]             160\n",
      "          Sigmoid-19              [4, 32, 1, 1]               0\n",
      "       RC_CALayer-20          [4, 32, 256, 256]               0\n",
      "             RCAB-21          [4, 32, 256, 256]               0\n",
      "           Conv2d-22          [4, 32, 256, 256]           9,248\n",
      "             ReLU-23          [4, 32, 256, 256]               0\n",
      "           Conv2d-24          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-25              [4, 32, 1, 1]               0\n",
      "           Conv2d-26               [4, 4, 1, 1]             132\n",
      "             ReLU-27               [4, 4, 1, 1]               0\n",
      "           Conv2d-28              [4, 32, 1, 1]             160\n",
      "          Sigmoid-29              [4, 32, 1, 1]               0\n",
      "       RC_CALayer-30          [4, 32, 256, 256]               0\n",
      "             RCAB-31          [4, 32, 256, 256]               0\n",
      "           Conv2d-32          [4, 32, 256, 256]           9,248\n",
      "             ReLU-33          [4, 32, 256, 256]               0\n",
      "           Conv2d-34          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-35              [4, 32, 1, 1]               0\n",
      "           Conv2d-36               [4, 4, 1, 1]             132\n",
      "             ReLU-37               [4, 4, 1, 1]               0\n",
      "           Conv2d-38              [4, 32, 1, 1]             160\n",
      "          Sigmoid-39              [4, 32, 1, 1]               0\n",
      "       RC_CALayer-40          [4, 32, 256, 256]               0\n",
      "             RCAB-41          [4, 32, 256, 256]               0\n",
      "           Conv2d-42          [4, 32, 256, 256]           9,248\n",
      "             ReLU-43          [4, 32, 256, 256]               0\n",
      "           Conv2d-44          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-45              [4, 32, 1, 1]               0\n",
      "           Conv2d-46               [4, 4, 1, 1]             132\n",
      "             ReLU-47               [4, 4, 1, 1]               0\n",
      "           Conv2d-48              [4, 32, 1, 1]             160\n",
      "          Sigmoid-49              [4, 32, 1, 1]               0\n",
      "       RC_CALayer-50          [4, 32, 256, 256]               0\n",
      "             RCAB-51          [4, 32, 256, 256]               0\n",
      "           Conv2d-52          [4, 32, 256, 256]           9,248\n",
      "             ReLU-53          [4, 32, 256, 256]               0\n",
      "           Conv2d-54          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-55              [4, 32, 1, 1]               0\n",
      "           Conv2d-56               [4, 4, 1, 1]             132\n",
      "             ReLU-57               [4, 4, 1, 1]               0\n",
      "           Conv2d-58              [4, 32, 1, 1]             160\n",
      "          Sigmoid-59              [4, 32, 1, 1]               0\n",
      "       RC_CALayer-60          [4, 32, 256, 256]               0\n",
      "             RCAB-61          [4, 32, 256, 256]               0\n",
      "           Conv2d-62          [4, 32, 256, 256]           9,248\n",
      "             ReLU-63          [4, 32, 256, 256]               0\n",
      "           Conv2d-64          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-65              [4, 32, 1, 1]               0\n",
      "           Conv2d-66               [4, 4, 1, 1]             132\n",
      "             ReLU-67               [4, 4, 1, 1]               0\n",
      "           Conv2d-68              [4, 32, 1, 1]             160\n",
      "          Sigmoid-69              [4, 32, 1, 1]               0\n",
      "       RC_CALayer-70          [4, 32, 256, 256]               0\n",
      "             RCAB-71          [4, 32, 256, 256]               0\n",
      "           Conv2d-72          [4, 32, 256, 256]           9,248\n",
      "             ReLU-73          [4, 32, 256, 256]               0\n",
      "           Conv2d-74          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-75              [4, 32, 1, 1]               0\n",
      "           Conv2d-76               [4, 4, 1, 1]             132\n",
      "             ReLU-77               [4, 4, 1, 1]               0\n",
      "           Conv2d-78              [4, 32, 1, 1]             160\n",
      "          Sigmoid-79              [4, 32, 1, 1]               0\n",
      "       RC_CALayer-80          [4, 32, 256, 256]               0\n",
      "             RCAB-81          [4, 32, 256, 256]               0\n",
      "           Conv2d-82          [4, 32, 256, 256]           9,248\n",
      "             ReLU-83          [4, 32, 256, 256]               0\n",
      "           Conv2d-84          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-85              [4, 32, 1, 1]               0\n",
      "           Conv2d-86               [4, 4, 1, 1]             132\n",
      "             ReLU-87               [4, 4, 1, 1]               0\n",
      "           Conv2d-88              [4, 32, 1, 1]             160\n",
      "          Sigmoid-89              [4, 32, 1, 1]               0\n",
      "       RC_CALayer-90          [4, 32, 256, 256]               0\n",
      "             RCAB-91          [4, 32, 256, 256]               0\n",
      "           Conv2d-92          [4, 32, 256, 256]           9,248\n",
      "             ReLU-93          [4, 32, 256, 256]               0\n",
      "           Conv2d-94          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-95              [4, 32, 1, 1]               0\n",
      "           Conv2d-96               [4, 4, 1, 1]             132\n",
      "             ReLU-97               [4, 4, 1, 1]               0\n",
      "           Conv2d-98              [4, 32, 1, 1]             160\n",
      "          Sigmoid-99              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-100          [4, 32, 256, 256]               0\n",
      "            RCAB-101          [4, 32, 256, 256]               0\n",
      "          Conv2d-102          [4, 32, 256, 256]           9,248\n",
      "   ResidualGroup-103          [4, 32, 256, 256]               0\n",
      "          Conv2d-104          [4, 32, 256, 256]           9,248\n",
      "            ReLU-105          [4, 32, 256, 256]               0\n",
      "          Conv2d-106          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-107              [4, 32, 1, 1]               0\n",
      "          Conv2d-108               [4, 4, 1, 1]             132\n",
      "            ReLU-109               [4, 4, 1, 1]               0\n",
      "          Conv2d-110              [4, 32, 1, 1]             160\n",
      "         Sigmoid-111              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-112          [4, 32, 256, 256]               0\n",
      "            RCAB-113          [4, 32, 256, 256]               0\n",
      "          Conv2d-114          [4, 32, 256, 256]           9,248\n",
      "            ReLU-115          [4, 32, 256, 256]               0\n",
      "          Conv2d-116          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-117              [4, 32, 1, 1]               0\n",
      "          Conv2d-118               [4, 4, 1, 1]             132\n",
      "            ReLU-119               [4, 4, 1, 1]               0\n",
      "          Conv2d-120              [4, 32, 1, 1]             160\n",
      "         Sigmoid-121              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-122          [4, 32, 256, 256]               0\n",
      "            RCAB-123          [4, 32, 256, 256]               0\n",
      "          Conv2d-124          [4, 32, 256, 256]           9,248\n",
      "            ReLU-125          [4, 32, 256, 256]               0\n",
      "          Conv2d-126          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-127              [4, 32, 1, 1]               0\n",
      "          Conv2d-128               [4, 4, 1, 1]             132\n",
      "            ReLU-129               [4, 4, 1, 1]               0\n",
      "          Conv2d-130              [4, 32, 1, 1]             160\n",
      "         Sigmoid-131              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-132          [4, 32, 256, 256]               0\n",
      "            RCAB-133          [4, 32, 256, 256]               0\n",
      "          Conv2d-134          [4, 32, 256, 256]           9,248\n",
      "            ReLU-135          [4, 32, 256, 256]               0\n",
      "          Conv2d-136          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-137              [4, 32, 1, 1]               0\n",
      "          Conv2d-138               [4, 4, 1, 1]             132\n",
      "            ReLU-139               [4, 4, 1, 1]               0\n",
      "          Conv2d-140              [4, 32, 1, 1]             160\n",
      "         Sigmoid-141              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-142          [4, 32, 256, 256]               0\n",
      "            RCAB-143          [4, 32, 256, 256]               0\n",
      "          Conv2d-144          [4, 32, 256, 256]           9,248\n",
      "            ReLU-145          [4, 32, 256, 256]               0\n",
      "          Conv2d-146          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-147              [4, 32, 1, 1]               0\n",
      "          Conv2d-148               [4, 4, 1, 1]             132\n",
      "            ReLU-149               [4, 4, 1, 1]               0\n",
      "          Conv2d-150              [4, 32, 1, 1]             160\n",
      "         Sigmoid-151              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-152          [4, 32, 256, 256]               0\n",
      "            RCAB-153          [4, 32, 256, 256]               0\n",
      "          Conv2d-154          [4, 32, 256, 256]           9,248\n",
      "            ReLU-155          [4, 32, 256, 256]               0\n",
      "          Conv2d-156          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-157              [4, 32, 1, 1]               0\n",
      "          Conv2d-158               [4, 4, 1, 1]             132\n",
      "            ReLU-159               [4, 4, 1, 1]               0\n",
      "          Conv2d-160              [4, 32, 1, 1]             160\n",
      "         Sigmoid-161              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-162          [4, 32, 256, 256]               0\n",
      "            RCAB-163          [4, 32, 256, 256]               0\n",
      "          Conv2d-164          [4, 32, 256, 256]           9,248\n",
      "            ReLU-165          [4, 32, 256, 256]               0\n",
      "          Conv2d-166          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-167              [4, 32, 1, 1]               0\n",
      "          Conv2d-168               [4, 4, 1, 1]             132\n",
      "            ReLU-169               [4, 4, 1, 1]               0\n",
      "          Conv2d-170              [4, 32, 1, 1]             160\n",
      "         Sigmoid-171              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-172          [4, 32, 256, 256]               0\n",
      "            RCAB-173          [4, 32, 256, 256]               0\n",
      "          Conv2d-174          [4, 32, 256, 256]           9,248\n",
      "            ReLU-175          [4, 32, 256, 256]               0\n",
      "          Conv2d-176          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-177              [4, 32, 1, 1]               0\n",
      "          Conv2d-178               [4, 4, 1, 1]             132\n",
      "            ReLU-179               [4, 4, 1, 1]               0\n",
      "          Conv2d-180              [4, 32, 1, 1]             160\n",
      "         Sigmoid-181              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-182          [4, 32, 256, 256]               0\n",
      "            RCAB-183          [4, 32, 256, 256]               0\n",
      "          Conv2d-184          [4, 32, 256, 256]           9,248\n",
      "            ReLU-185          [4, 32, 256, 256]               0\n",
      "          Conv2d-186          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-187              [4, 32, 1, 1]               0\n",
      "          Conv2d-188               [4, 4, 1, 1]             132\n",
      "            ReLU-189               [4, 4, 1, 1]               0\n",
      "          Conv2d-190              [4, 32, 1, 1]             160\n",
      "         Sigmoid-191              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-192          [4, 32, 256, 256]               0\n",
      "            RCAB-193          [4, 32, 256, 256]               0\n",
      "          Conv2d-194          [4, 32, 256, 256]           9,248\n",
      "            ReLU-195          [4, 32, 256, 256]               0\n",
      "          Conv2d-196          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-197              [4, 32, 1, 1]               0\n",
      "          Conv2d-198               [4, 4, 1, 1]             132\n",
      "            ReLU-199               [4, 4, 1, 1]               0\n",
      "          Conv2d-200              [4, 32, 1, 1]             160\n",
      "         Sigmoid-201              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-202          [4, 32, 256, 256]               0\n",
      "            RCAB-203          [4, 32, 256, 256]               0\n",
      "          Conv2d-204          [4, 32, 256, 256]           9,248\n",
      "   ResidualGroup-205          [4, 32, 256, 256]               0\n",
      "          Conv2d-206          [4, 32, 256, 256]           9,248\n",
      "            ReLU-207          [4, 32, 256, 256]               0\n",
      "          Conv2d-208          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-209              [4, 32, 1, 1]               0\n",
      "          Conv2d-210               [4, 4, 1, 1]             132\n",
      "            ReLU-211               [4, 4, 1, 1]               0\n",
      "          Conv2d-212              [4, 32, 1, 1]             160\n",
      "         Sigmoid-213              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-214          [4, 32, 256, 256]               0\n",
      "            RCAB-215          [4, 32, 256, 256]               0\n",
      "          Conv2d-216          [4, 32, 256, 256]           9,248\n",
      "            ReLU-217          [4, 32, 256, 256]               0\n",
      "          Conv2d-218          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-219              [4, 32, 1, 1]               0\n",
      "          Conv2d-220               [4, 4, 1, 1]             132\n",
      "            ReLU-221               [4, 4, 1, 1]               0\n",
      "          Conv2d-222              [4, 32, 1, 1]             160\n",
      "         Sigmoid-223              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-224          [4, 32, 256, 256]               0\n",
      "            RCAB-225          [4, 32, 256, 256]               0\n",
      "          Conv2d-226          [4, 32, 256, 256]           9,248\n",
      "            ReLU-227          [4, 32, 256, 256]               0\n",
      "          Conv2d-228          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-229              [4, 32, 1, 1]               0\n",
      "          Conv2d-230               [4, 4, 1, 1]             132\n",
      "            ReLU-231               [4, 4, 1, 1]               0\n",
      "          Conv2d-232              [4, 32, 1, 1]             160\n",
      "         Sigmoid-233              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-234          [4, 32, 256, 256]               0\n",
      "            RCAB-235          [4, 32, 256, 256]               0\n",
      "          Conv2d-236          [4, 32, 256, 256]           9,248\n",
      "            ReLU-237          [4, 32, 256, 256]               0\n",
      "          Conv2d-238          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-239              [4, 32, 1, 1]               0\n",
      "          Conv2d-240               [4, 4, 1, 1]             132\n",
      "            ReLU-241               [4, 4, 1, 1]               0\n",
      "          Conv2d-242              [4, 32, 1, 1]             160\n",
      "         Sigmoid-243              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-244          [4, 32, 256, 256]               0\n",
      "            RCAB-245          [4, 32, 256, 256]               0\n",
      "          Conv2d-246          [4, 32, 256, 256]           9,248\n",
      "            ReLU-247          [4, 32, 256, 256]               0\n",
      "          Conv2d-248          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-249              [4, 32, 1, 1]               0\n",
      "          Conv2d-250               [4, 4, 1, 1]             132\n",
      "            ReLU-251               [4, 4, 1, 1]               0\n",
      "          Conv2d-252              [4, 32, 1, 1]             160\n",
      "         Sigmoid-253              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-254          [4, 32, 256, 256]               0\n",
      "            RCAB-255          [4, 32, 256, 256]               0\n",
      "          Conv2d-256          [4, 32, 256, 256]           9,248\n",
      "            ReLU-257          [4, 32, 256, 256]               0\n",
      "          Conv2d-258          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-259              [4, 32, 1, 1]               0\n",
      "          Conv2d-260               [4, 4, 1, 1]             132\n",
      "            ReLU-261               [4, 4, 1, 1]               0\n",
      "          Conv2d-262              [4, 32, 1, 1]             160\n",
      "         Sigmoid-263              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-264          [4, 32, 256, 256]               0\n",
      "            RCAB-265          [4, 32, 256, 256]               0\n",
      "          Conv2d-266          [4, 32, 256, 256]           9,248\n",
      "            ReLU-267          [4, 32, 256, 256]               0\n",
      "          Conv2d-268          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-269              [4, 32, 1, 1]               0\n",
      "          Conv2d-270               [4, 4, 1, 1]             132\n",
      "            ReLU-271               [4, 4, 1, 1]               0\n",
      "          Conv2d-272              [4, 32, 1, 1]             160\n",
      "         Sigmoid-273              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-274          [4, 32, 256, 256]               0\n",
      "            RCAB-275          [4, 32, 256, 256]               0\n",
      "          Conv2d-276          [4, 32, 256, 256]           9,248\n",
      "            ReLU-277          [4, 32, 256, 256]               0\n",
      "          Conv2d-278          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-279              [4, 32, 1, 1]               0\n",
      "          Conv2d-280               [4, 4, 1, 1]             132\n",
      "            ReLU-281               [4, 4, 1, 1]               0\n",
      "          Conv2d-282              [4, 32, 1, 1]             160\n",
      "         Sigmoid-283              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-284          [4, 32, 256, 256]               0\n",
      "            RCAB-285          [4, 32, 256, 256]               0\n",
      "          Conv2d-286          [4, 32, 256, 256]           9,248\n",
      "            ReLU-287          [4, 32, 256, 256]               0\n",
      "          Conv2d-288          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-289              [4, 32, 1, 1]               0\n",
      "          Conv2d-290               [4, 4, 1, 1]             132\n",
      "            ReLU-291               [4, 4, 1, 1]               0\n",
      "          Conv2d-292              [4, 32, 1, 1]             160\n",
      "         Sigmoid-293              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-294          [4, 32, 256, 256]               0\n",
      "            RCAB-295          [4, 32, 256, 256]               0\n",
      "          Conv2d-296          [4, 32, 256, 256]           9,248\n",
      "            ReLU-297          [4, 32, 256, 256]               0\n",
      "          Conv2d-298          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-299              [4, 32, 1, 1]               0\n",
      "          Conv2d-300               [4, 4, 1, 1]             132\n",
      "            ReLU-301               [4, 4, 1, 1]               0\n",
      "          Conv2d-302              [4, 32, 1, 1]             160\n",
      "         Sigmoid-303              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-304          [4, 32, 256, 256]               0\n",
      "            RCAB-305          [4, 32, 256, 256]               0\n",
      "          Conv2d-306          [4, 32, 256, 256]           9,248\n",
      "   ResidualGroup-307          [4, 32, 256, 256]               0\n",
      "          Conv2d-308          [4, 32, 256, 256]           9,248\n",
      "            ReLU-309          [4, 32, 256, 256]               0\n",
      "          Conv2d-310          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-311              [4, 32, 1, 1]               0\n",
      "          Conv2d-312               [4, 4, 1, 1]             132\n",
      "            ReLU-313               [4, 4, 1, 1]               0\n",
      "          Conv2d-314              [4, 32, 1, 1]             160\n",
      "         Sigmoid-315              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-316          [4, 32, 256, 256]               0\n",
      "            RCAB-317          [4, 32, 256, 256]               0\n",
      "          Conv2d-318          [4, 32, 256, 256]           9,248\n",
      "            ReLU-319          [4, 32, 256, 256]               0\n",
      "          Conv2d-320          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-321              [4, 32, 1, 1]               0\n",
      "          Conv2d-322               [4, 4, 1, 1]             132\n",
      "            ReLU-323               [4, 4, 1, 1]               0\n",
      "          Conv2d-324              [4, 32, 1, 1]             160\n",
      "         Sigmoid-325              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-326          [4, 32, 256, 256]               0\n",
      "            RCAB-327          [4, 32, 256, 256]               0\n",
      "          Conv2d-328          [4, 32, 256, 256]           9,248\n",
      "            ReLU-329          [4, 32, 256, 256]               0\n",
      "          Conv2d-330          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-331              [4, 32, 1, 1]               0\n",
      "          Conv2d-332               [4, 4, 1, 1]             132\n",
      "            ReLU-333               [4, 4, 1, 1]               0\n",
      "          Conv2d-334              [4, 32, 1, 1]             160\n",
      "         Sigmoid-335              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-336          [4, 32, 256, 256]               0\n",
      "            RCAB-337          [4, 32, 256, 256]               0\n",
      "          Conv2d-338          [4, 32, 256, 256]           9,248\n",
      "            ReLU-339          [4, 32, 256, 256]               0\n",
      "          Conv2d-340          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-341              [4, 32, 1, 1]               0\n",
      "          Conv2d-342               [4, 4, 1, 1]             132\n",
      "            ReLU-343               [4, 4, 1, 1]               0\n",
      "          Conv2d-344              [4, 32, 1, 1]             160\n",
      "         Sigmoid-345              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-346          [4, 32, 256, 256]               0\n",
      "            RCAB-347          [4, 32, 256, 256]               0\n",
      "          Conv2d-348          [4, 32, 256, 256]           9,248\n",
      "            ReLU-349          [4, 32, 256, 256]               0\n",
      "          Conv2d-350          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-351              [4, 32, 1, 1]               0\n",
      "          Conv2d-352               [4, 4, 1, 1]             132\n",
      "            ReLU-353               [4, 4, 1, 1]               0\n",
      "          Conv2d-354              [4, 32, 1, 1]             160\n",
      "         Sigmoid-355              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-356          [4, 32, 256, 256]               0\n",
      "            RCAB-357          [4, 32, 256, 256]               0\n",
      "          Conv2d-358          [4, 32, 256, 256]           9,248\n",
      "            ReLU-359          [4, 32, 256, 256]               0\n",
      "          Conv2d-360          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-361              [4, 32, 1, 1]               0\n",
      "          Conv2d-362               [4, 4, 1, 1]             132\n",
      "            ReLU-363               [4, 4, 1, 1]               0\n",
      "          Conv2d-364              [4, 32, 1, 1]             160\n",
      "         Sigmoid-365              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-366          [4, 32, 256, 256]               0\n",
      "            RCAB-367          [4, 32, 256, 256]               0\n",
      "          Conv2d-368          [4, 32, 256, 256]           9,248\n",
      "            ReLU-369          [4, 32, 256, 256]               0\n",
      "          Conv2d-370          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-371              [4, 32, 1, 1]               0\n",
      "          Conv2d-372               [4, 4, 1, 1]             132\n",
      "            ReLU-373               [4, 4, 1, 1]               0\n",
      "          Conv2d-374              [4, 32, 1, 1]             160\n",
      "         Sigmoid-375              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-376          [4, 32, 256, 256]               0\n",
      "            RCAB-377          [4, 32, 256, 256]               0\n",
      "          Conv2d-378          [4, 32, 256, 256]           9,248\n",
      "            ReLU-379          [4, 32, 256, 256]               0\n",
      "          Conv2d-380          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-381              [4, 32, 1, 1]               0\n",
      "          Conv2d-382               [4, 4, 1, 1]             132\n",
      "            ReLU-383               [4, 4, 1, 1]               0\n",
      "          Conv2d-384              [4, 32, 1, 1]             160\n",
      "         Sigmoid-385              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-386          [4, 32, 256, 256]               0\n",
      "            RCAB-387          [4, 32, 256, 256]               0\n",
      "          Conv2d-388          [4, 32, 256, 256]           9,248\n",
      "            ReLU-389          [4, 32, 256, 256]               0\n",
      "          Conv2d-390          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-391              [4, 32, 1, 1]               0\n",
      "          Conv2d-392               [4, 4, 1, 1]             132\n",
      "            ReLU-393               [4, 4, 1, 1]               0\n",
      "          Conv2d-394              [4, 32, 1, 1]             160\n",
      "         Sigmoid-395              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-396          [4, 32, 256, 256]               0\n",
      "            RCAB-397          [4, 32, 256, 256]               0\n",
      "          Conv2d-398          [4, 32, 256, 256]           9,248\n",
      "            ReLU-399          [4, 32, 256, 256]               0\n",
      "          Conv2d-400          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-401              [4, 32, 1, 1]               0\n",
      "          Conv2d-402               [4, 4, 1, 1]             132\n",
      "            ReLU-403               [4, 4, 1, 1]               0\n",
      "          Conv2d-404              [4, 32, 1, 1]             160\n",
      "         Sigmoid-405              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-406          [4, 32, 256, 256]               0\n",
      "            RCAB-407          [4, 32, 256, 256]               0\n",
      "          Conv2d-408          [4, 32, 256, 256]           9,248\n",
      "   ResidualGroup-409          [4, 32, 256, 256]               0\n",
      "          Conv2d-410          [4, 32, 256, 256]           9,248\n",
      "            ReLU-411          [4, 32, 256, 256]               0\n",
      "          Conv2d-412          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-413              [4, 32, 1, 1]               0\n",
      "          Conv2d-414               [4, 4, 1, 1]             132\n",
      "            ReLU-415               [4, 4, 1, 1]               0\n",
      "          Conv2d-416              [4, 32, 1, 1]             160\n",
      "         Sigmoid-417              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-418          [4, 32, 256, 256]               0\n",
      "            RCAB-419          [4, 32, 256, 256]               0\n",
      "          Conv2d-420          [4, 32, 256, 256]           9,248\n",
      "            ReLU-421          [4, 32, 256, 256]               0\n",
      "          Conv2d-422          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-423              [4, 32, 1, 1]               0\n",
      "          Conv2d-424               [4, 4, 1, 1]             132\n",
      "            ReLU-425               [4, 4, 1, 1]               0\n",
      "          Conv2d-426              [4, 32, 1, 1]             160\n",
      "         Sigmoid-427              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-428          [4, 32, 256, 256]               0\n",
      "            RCAB-429          [4, 32, 256, 256]               0\n",
      "          Conv2d-430          [4, 32, 256, 256]           9,248\n",
      "            ReLU-431          [4, 32, 256, 256]               0\n",
      "          Conv2d-432          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-433              [4, 32, 1, 1]               0\n",
      "          Conv2d-434               [4, 4, 1, 1]             132\n",
      "            ReLU-435               [4, 4, 1, 1]               0\n",
      "          Conv2d-436              [4, 32, 1, 1]             160\n",
      "         Sigmoid-437              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-438          [4, 32, 256, 256]               0\n",
      "            RCAB-439          [4, 32, 256, 256]               0\n",
      "          Conv2d-440          [4, 32, 256, 256]           9,248\n",
      "            ReLU-441          [4, 32, 256, 256]               0\n",
      "          Conv2d-442          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-443              [4, 32, 1, 1]               0\n",
      "          Conv2d-444               [4, 4, 1, 1]             132\n",
      "            ReLU-445               [4, 4, 1, 1]               0\n",
      "          Conv2d-446              [4, 32, 1, 1]             160\n",
      "         Sigmoid-447              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-448          [4, 32, 256, 256]               0\n",
      "            RCAB-449          [4, 32, 256, 256]               0\n",
      "          Conv2d-450          [4, 32, 256, 256]           9,248\n",
      "            ReLU-451          [4, 32, 256, 256]               0\n",
      "          Conv2d-452          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-453              [4, 32, 1, 1]               0\n",
      "          Conv2d-454               [4, 4, 1, 1]             132\n",
      "            ReLU-455               [4, 4, 1, 1]               0\n",
      "          Conv2d-456              [4, 32, 1, 1]             160\n",
      "         Sigmoid-457              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-458          [4, 32, 256, 256]               0\n",
      "            RCAB-459          [4, 32, 256, 256]               0\n",
      "          Conv2d-460          [4, 32, 256, 256]           9,248\n",
      "            ReLU-461          [4, 32, 256, 256]               0\n",
      "          Conv2d-462          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-463              [4, 32, 1, 1]               0\n",
      "          Conv2d-464               [4, 4, 1, 1]             132\n",
      "            ReLU-465               [4, 4, 1, 1]               0\n",
      "          Conv2d-466              [4, 32, 1, 1]             160\n",
      "         Sigmoid-467              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-468          [4, 32, 256, 256]               0\n",
      "            RCAB-469          [4, 32, 256, 256]               0\n",
      "          Conv2d-470          [4, 32, 256, 256]           9,248\n",
      "            ReLU-471          [4, 32, 256, 256]               0\n",
      "          Conv2d-472          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-473              [4, 32, 1, 1]               0\n",
      "          Conv2d-474               [4, 4, 1, 1]             132\n",
      "            ReLU-475               [4, 4, 1, 1]               0\n",
      "          Conv2d-476              [4, 32, 1, 1]             160\n",
      "         Sigmoid-477              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-478          [4, 32, 256, 256]               0\n",
      "            RCAB-479          [4, 32, 256, 256]               0\n",
      "          Conv2d-480          [4, 32, 256, 256]           9,248\n",
      "            ReLU-481          [4, 32, 256, 256]               0\n",
      "          Conv2d-482          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-483              [4, 32, 1, 1]               0\n",
      "          Conv2d-484               [4, 4, 1, 1]             132\n",
      "            ReLU-485               [4, 4, 1, 1]               0\n",
      "          Conv2d-486              [4, 32, 1, 1]             160\n",
      "         Sigmoid-487              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-488          [4, 32, 256, 256]               0\n",
      "            RCAB-489          [4, 32, 256, 256]               0\n",
      "          Conv2d-490          [4, 32, 256, 256]           9,248\n",
      "            ReLU-491          [4, 32, 256, 256]               0\n",
      "          Conv2d-492          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-493              [4, 32, 1, 1]               0\n",
      "          Conv2d-494               [4, 4, 1, 1]             132\n",
      "            ReLU-495               [4, 4, 1, 1]               0\n",
      "          Conv2d-496              [4, 32, 1, 1]             160\n",
      "         Sigmoid-497              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-498          [4, 32, 256, 256]               0\n",
      "            RCAB-499          [4, 32, 256, 256]               0\n",
      "          Conv2d-500          [4, 32, 256, 256]           9,248\n",
      "            ReLU-501          [4, 32, 256, 256]               0\n",
      "          Conv2d-502          [4, 32, 256, 256]           9,248\n",
      "AdaptiveAvgPool2d-503              [4, 32, 1, 1]               0\n",
      "          Conv2d-504               [4, 4, 1, 1]             132\n",
      "            ReLU-505               [4, 4, 1, 1]               0\n",
      "          Conv2d-506              [4, 32, 1, 1]             160\n",
      "         Sigmoid-507              [4, 32, 1, 1]               0\n",
      "      RC_CALayer-508          [4, 32, 256, 256]               0\n",
      "            RCAB-509          [4, 32, 256, 256]               0\n",
      "          Conv2d-510          [4, 32, 256, 256]           9,248\n",
      "   ResidualGroup-511          [4, 32, 256, 256]               0\n",
      "          Conv2d-512          [4, 32, 256, 256]           9,248\n",
      "================================================================\n",
      "Total params: 995,784\n",
      "Trainable params: 995,784\n",
      "Non-trainable params: 0\n",
      "----------------------------------------------------------------\n",
      "Input size (MB): 3.00\n",
      "Forward/backward pass size (MB): 15999.84\n",
      "Params size (MB): 3.80\n",
      "Estimated Total Size (MB): 16006.64\n",
      "----------------------------------------------------------------\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\earthyzinc\\Programs\\miniconda\\Lib\\site-packages\\torchsummary\\torchsummary.py:93: RuntimeWarning: overflow encountered in scalar add\n",
      "  total_output += np.prod(summary[layer][\"output_shape\"])\n"
     ]
    }
   ],
   "source": [
    "from basicsr.archs.module.rcan import RCAN\n",
    "from torch import nn\n",
    "from basicsr.archs.module import VGGFeatureExtractor\n",
    "from torchsummary import summary\n",
    "\n",
    "rcan = RCAN()\n",
    "\n",
    "summary(model=rcan, input_size=(3, 256, 256), batch_size=4, device=\"cpu\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "----------------------------------------------------------------\n",
      "        Layer (type)               Output Shape         Param #\n",
      "================================================================\n",
      "   ReflectionPad2d-1          [4, 33, 262, 262]               0\n",
      "            Conv2d-2           [4, 3, 256, 256]           4,854\n",
      "              Tanh-3           [4, 3, 256, 256]               0\n",
      "================================================================\n",
      "Total params: 4,854\n",
      "Trainable params: 4,854\n",
      "Non-trainable params: 0\n",
      "----------------------------------------------------------------\n",
      "Input size (MB): 33.00\n",
      "Forward/backward pass size (MB): 81.13\n",
      "Params size (MB): 0.02\n",
      "Estimated Total Size (MB): 114.15\n",
      "----------------------------------------------------------------\n"
     ]
    }
   ],
   "source": [
    "tail = nn.Sequential(\n",
    "    nn.ReflectionPad2d(3),\n",
    "    nn.Conv2d(33, 3, kernel_size=7, padding=0),\n",
    "    nn.Tanh()\n",
    ")\n",
    "summary(model=tail, input_size=(33, 256, 256), batch_size=4, device=\"cpu\")"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-01-15T09:23:38.121263200Z",
     "start_time": "2024-01-15T09:23:38.084309300Z"
    }
   },
   "id": "5e6627754bf95d22"
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "outputs": [
    {
     "ename": "AttributeError",
     "evalue": "'HazeOnlineDataset' object has no attribute 'show_img_example'",
     "output_type": "error",
     "traceback": [
      "\u001B[1;31m---------------------------------------------------------------------------\u001B[0m",
      "\u001B[1;31mAttributeError\u001B[0m                            Traceback (most recent call last)",
      "Cell \u001B[1;32mIn[20], line 1\u001B[0m\n\u001B[1;32m----> 1\u001B[0m \u001B[43mtrain_set\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mshow_img_example\u001B[49m()\n",
      "\u001B[1;31mAttributeError\u001B[0m: 'HazeOnlineDataset' object has no attribute 'show_img_example'"
     ]
    }
   ],
   "source": [
    "train_set.show_img_example()"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-01-15T04:41:34.975267600Z",
     "start_time": "2024-01-15T04:41:34.965966200Z"
    }
   },
   "id": "90789aaf620bd1dd"
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [],
   "metadata": {
    "collapsed": false
   },
   "id": "c5675b2a9c9bb6f3"
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
